<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       xmlns:c="http://java.sun.com/jsp/jstl/core">      
    <h:head>
        <title><h:outputText>Vorlesung #{lectureBean.lecture.name} Belegwünsche anzeigen</h:outputText></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">                        
            <ui:define name="content">
                
                <ice:dataTable value="#{viewAllScoreBean.list}"
                               var="row">
                    <ice:column>
                        <ice:outputText value="#{row.user.studentId}" />
                        <ice:outputText value="#{row.tasksCategorys.size()}" />
                    </ice:column>
                    
                    <ice:column>
                        <ice:outputText value="#{row.user.lastName}" />
                    </ice:column>
                    
                    <ice:column>
                        <ice:outputText value="#{row.user.firstName}" />
                    </ice:column>
                    
                    <ice:columns value="#{viewAllScoreBean.captions}"
                                 var="headerName"
                                 varStatus="stat">
                        <f:facet name="header"><ice:outputText value="#{headerName}" /></f:facet>
                        <ice:panelGroup rendered="#{row.tasksCategorys.get(stat.index).hasRequirement}"
                                        style="color:green;">
                            <ice:outputText value="#{row.tasksCategorys.get(stat.index).sum}"
                                            rendered="#{row.tasksCategorys.get(stat.index).valued}"
                                            style="color:green;"/>
                            <ice:outputText value=" (#{row.tasksCategorys.get(stat.index).percent} %)"
                                            rendered="#{row.tasksCategorys.get(stat.index).valued}"
                                            style="color:green;"/>
                        </ice:panelGroup>    
                        
                        <ice:panelGroup rendered="#{!row.tasksCategorys.get(stat.index).hasRequirement}"
                                        style="color:red;">
                            <ice:outputText value="#{row.tasksCategorys.get(stat.index).sum}"
                                            rendered="#{row.tasksCategorys.get(stat.index).valued}"
                                            style="color:red;"/>
                            <ice:outputText value=" (#{row.tasksCategorys.get(stat.index).percent} %)"
                                            rendered="#{row.tasksCategorys.get(stat.index).valued}"
                                            style="color:red;"/>
                        </ice:panelGroup>
                        <ice:outputText value="Nicht gewertet"
                                        rendered="#{!row.tasksCategorys.get(stat.index).valued}" />
                    </ice:columns>
                </ice:dataTable>
            <!--<h:form>
                <ice:outputText value="Punkte eintragen" />
                <ice:dataTable value="#{lectureBean.lecture.info.users}"
                               var ="row"
                               id="scoreTable">
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Username" /></f:facet>
                        <ice:outputText value="#{row.username}" />
                    </ice:column>                    
                    <ice:columns value="#{lectureBean.lecture.exerciseSheets}"
                                 var="col">                        
                        <f:facet name="header"><ice:outputText value="#{col.name}" /></f:facet>
                        <ice:outputText value="#{viewScoreBean.sumScore(col,row.username).key}" />
                    </ice:columns>
                </ice:dataTable>
                <ice:dataExporter type="excel"
                                  label="Exportieren"
                                  for="scoreTable"/>
            </h:form>-->
            </ui:define>
        </ui:composition>
    </h:body>
</html>